<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="<%=basePath%>">
	<title>产品添加</title>


	<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
	<script src="js/jquery.validate.js" type="text/javascript" ></script>
	<script src="js/jquery.divbox.js" type="text/javascript"></script>
	<script src="js/json2.js" type="text/javascript"></script>
	<style type="text/css">

		.ration_table_title{ width:100%;border-left:1px #bbcddb solid; border-top:1px #bbcddb solid; background-color:#f6f7f9;}
		.ration_table_title th{ color:#343233; width:12%; text-align:right; line-height:26px; border-bottom:1px #bbcddb solid; border-right:1px #bbcddb solid;font-weight:normal; padding-right:10px;}
		.ration_table_title td{ color:#343233; text-align:left; line-height:26px; border-bottom:1px #bbcddb solid; border-right:1px #bbcddb solid;   padding:5px 0 5px 10px;}
		.ration_table{ width:100%;  border-left:1px #bbcddb solid; border-top:1px #bbcddb solid; background-color:#f6f7f9;font-size: 12px;}
		.ration_table th{ color:#343233; width:11%; text-align:center; line-height:26px; border-bottom:1px #bbcddb solid; border-right:1px #bbcddb solid; background-color:#f6f7f9;}
		.ration_table td{text-align:center; line-height:26px;border-bottom:1px #bbcddb solid; border-right:1px #bbcddb solid;}
		.ration_table .table_02 td, .table_02 .content_table_1 td{padding-left: 2px;padding-right: 2px}

		.input_text {
			width: 250px;
		}
		.select_1 {
			width: 250px;
		}
		input.fieldError {
			border: 1px solid #ffb042;
			background-color: #fffbf5;
		}
		textarea.fieldError {
			border: 1px solid #ffb042;
			background-color: #fffbf5;
		}
		label.fieldError {
			line-height: 23px;
			color: #ffb042;
			padding-left: 6px;
		}
	</style>
	<script type="text/javascript">
		//自定义map功能
		function Map(){
			this.elements = new Array();
			//获取MAP元素个数
			this.size = function() {
				return this.elements.length;
			};
			//判断MAP是否为空
			this.isEmpty = function() {
				return (this.elements.length < 1);
			};
			//删除MAP所有元素
			this.clear = function() {
				this.elements = new Array();
			};
			//向MAP中增加元素（key, value)
			this.put = function(_key, _value) {
				if(this.containsKey(_key)){
					this.remove(_key);
					this.elements.push( {
						key : _key,
						value : _value
					});
				}else{
					this.elements.push( {
						key : _key,
						value : _value
					});
				}
			};
			//删除指定KEY的元素，成功返回True，失败返回False
			this.remove = function(_key) {
				var bln = false;
				try {
					for (var i = 0; i < this.elements.length; i++) {
						if (this.elements[i].key == _key) {
							this.elements.splice(i, 1);
							return true;
						}
					}
				} catch (e) {
					bln = false;
				}
				return bln;
			};
			//获取指定KEY的元素值VALUE，失败返回NULL
			this.get = function(_key) {
				try {
					for (var i = 0; i < this.elements.length; i++) {
						if (this.elements[i].key == _key) {
							return this.elements[i].value;
						}
					}
				} catch (e) {
					return false;
				}
				return false;
			};
			//判断MAP中是否含有指定KEY的元素
			this.containsKey = function(_key) {
				var bln = false;
				try {
					for (var i = 0; i < this.elements.length; i++) {
						if (this.elements[i].key == _key) {
							bln = true;
						}
					}
				} catch (e) {
					bln = false;
				}
				return bln;
			};
			//获取map的所有values
			this.values = function() {
				var arr = new Array();
				for (var i = 0; i < this.elements.length; i++) {
					arr.push(this.elements[i].value);
				}
				return arr;
			};
			//获取map的所有keys
			this.keys= function() {
				var arr = new Array();
				for (var i = 0; i < this.elements.length; i++) {
					arr.push(this.elements[i].key);
				}
				return arr;
			};
			//获取数组
			this.getArray= function(){
				var arr = new Array();
				for (var i = 0; i < this.elements.length; i++) {
					arr.push({
						key : this.elements[i].key,
						value : this.elements[i].value
					});
				}
				return arr;
			};
		}
		//********************************************
		var startP=1;
		var Formstatus=true;
		var tradProdCode=0;
		var map=new Map();
		var levelUpArr = new Array('1','2','3','4','5','6');
		var specaialCodeName = new Array();
		var riskMainType = "";
		$(document).ready(function() {
			loadDiscountType();//加载"折扣系数"下拉列表
			var $prodInstCode = $("#prodInstCode");
			var $tradProdDesc = $("#tradProdDesc");
			var $tradAppType = $("#tradAppType");
			var $unitPp = $("#unitPp");
			var $maxDelayDay = $("#maxDelayDay");
			var $minDelayDay = $("#minDelayDay");
			var $instant = $("#instant");
			var $minDays = $("#minDays");
			var $maxDays = $("#maxDays");
			var $sub = $("#sub");
			var $longestCancelDay =$("#longestCancelDay");
			//最短延时起保时间：不小于0的整数，且首位非0
			$minDelayDay.change(function(){
				if($minDelayDay.val()!=""){
					var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*|-[1-9][0-9]*)$");
					var delayflag = minDelayDayReg.test($minDelayDay.val());
					if(!delayflag) $.message("error","天数必须是整数");
				}
			});

			//最长注销天数
			$longestCancelDay.change(function(){
				if($longestCancelDay.val()!=""){
					var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*)$");
					var delayflag = minDelayDayReg.test($longestCancelDay.val());
					if(!delayflag) $.message("error","最长注销天数必须是大于等于0的整数");
				}
			});
			//最长延时起保时间：不小于0的整数，且首位非0
			$maxDelayDay.change(function(){
				if($maxDelayDay.val()!=""){
					var maxDelayDayReg = new RegExp("^(0|[1-9][0-9]*)$");
					var delayflag = maxDelayDayReg.test($maxDelayDay.val());
					if(!delayflag){
						$.message("error","最长延时起保时间必须是不小于0的整数");
						return;
					}
					if(parseInt($minDelayDay.val())>parseInt($maxDelayDay.val())){
						$.message("error","最长延时起保时间不能小于延时起保天数");
						return;
					}
				}
			});

			//最短保险天数：大于等于1的正整数
			$minDays.change(function(){
				if($minDays.val()!=""){
					var minDayReg = new RegExp("^[1-9][0-9]*$");
					var minDayflag = minDayReg.test($minDays.val());
					if(!minDayflag) $.message("error","最短保险天数必须是不小于1的整数");
				}
			});

			//最长保险天数：大于等于1的正整数，且必须大于最短保险天数
			$maxDays.change(function(){
				if($maxDays.val()!=""){
					var maxDayReg = new RegExp("^[1-9][0-9]*$");
					var maxDayflag = maxDayReg.test($maxDays.val());
					if(!maxDayflag){
						$.message("error","最长保险天数必须是不小于1的整数");
						return;
					}
					if(parseInt($minDays.val())>parseInt($maxDays.val())){
						$.message("error","最长保险天数不能小于最短保险天数");
						return;
					}
				}
			});
			//最大份数：不小于0的整数，且首位非0
			$unitPp.change(function(){
				if($unitPp.val()!=""){
					var unitPpReg = new RegExp("^(0|[1-9][0-9]*)$");
					var ppflag = unitPpReg.test($unitPp.val());
					if(!ppflag) $.message("error","最大份数必须是不小于0的整数");
				}
			});
		});

		/*-----------------------------2015年6月3日17:27:07-----wangyan------add↓---*/
		//获取折扣系数选项
		function loadDiscountType(){
			$.ajax({
				url : "product/getDiscountType",
				type : 'POST',
				async : true,
				dataType:'json',
				success:function(discountTypeList){
					if($.validate(discountTypeList))return;

					if(null!=discountTypeList && discountTypeList[0]!=undefined){
						$.each(discountTypeList,function(i,item){
							$("#adjust").append("<option value="+item.ADJUSTID+">"+item.ADJUSTDESC+"</option>");
						});
					}
				}
			});
		}
		function addAdjustDiv(){
			var adjustVal = $("#adjust").val()
			if(adjustVal!=""){
				$("#adjustDiv").append("<div>"+
						"<input name='peoplenum' type='text' style='width:55px;' class='input_text'>&nbsp;人&nbsp;<input name='coefficient' type='text'  style='width:55px;' class='input_text'>&nbsp;%&nbsp;&nbsp;<input type='button'  value='-' onclick='removeAdjustDiv(this)'>"
						+"</div>");
			}
		}
		function removeAdjustDiv(o){
			$(o).parent().remove()
		}

		/*-----------------2015年6月3日17:27:07------wangyan-----add↑-----*/
		//表单校验
		function checkFormFormate(){
			var $prodInstCode = $("#prodInstCode");
			var $prodInstName = $("#prodNme");
			var $tradProdDesc = $("#tradProdDesc");
			var $tradAppType = $("#tradAppType");
			var $prodType = $("#prodType");
			var $unitPp = $("#unitPp");
			var $maxDelayDay = $("#maxDelayDay");
			var $minDelayDay = $("#minDelayDay");
			var $instant = $("#instant");
			var $minDays = $("#minDays");
			var $maxDays = $("#maxDays");
			var $limit = $("#ageLimit");
			var $minAge = $("#minAge");
			var $maxAge = $("#maxAge");
			var $minAgeUnit = $("#minAgeUnit");
			var $maxAgeUnit = $("#maxAgeUnit");
			var $maxOccupLevel=$("#maxOccupLevel");
			var $insuredNoLimit=$("#insuredNoLimit");
			var $minInsuredNo= $("#minInsuredNo");
			var $poolType = $("#poolType");
			var $longestCancelDay =$("#longestCancelDay");

			if($.trim($prodInstCode.val()).length==0){
				$.message("error","请选择产品模板");
				$prodInstCode.focus();
				return false;
			}
			//产品模板名称
			if($.trim($prodInstName.val()).length==0){
				$.message("error","产品模板名称不能为空");
				$prodInstName.focus();
				return false;
			}
			//产品描述
			if($.trim($tradProdDesc.val()).length==0){
				$.message("error","交易系统产品名称不能为空");
				$tradProdDesc.focus();
				return false;
			}
			//交易系统投保类型
			if($.trim($tradAppType.val()).length==0){
				$.message("error","个团标识不能为空");
				$tradAppType.focus();
				return false;
			}
			//最长注销天数:只能填入大于等于0的整数，默认为0.
			if($.trim($longestCancelDay.val()).length=0){
				$.message("error","请输入最长注销天数");
				$longestCancelDay.focus();
				return false;
			}else{
				//alert($longestCancelDay.val());
				var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*)$");
				var delayflag = minDelayDayReg.test($longestCancelDay.val());
				if(!delayflag){
					$.message("error","最长注销天数必须是不小于0的整数")
					$longestCancelDay.focus();
					return false;
				}
			}

			//最短延时起保时间：不小于0的整数，且首位非0
			if($.trim($minDelayDay.val()).length==0){
				$.message("error","请输入最短延时起保时间");
				$minDelayDay.focus();
				return false;
			}else{
				var minDelayDayReg = new RegExp("^(0|[1-9][0-9]*|-[1-9][0-9]*)$");
				var delayflag = minDelayDayReg.test($minDelayDay.val());
				if(!delayflag){
					$.message("error","最短延时起保时间必须是不小于0的整数");
					$minDelayDay.focus();
					return false;
				}
			}
			//最长延时起保时间：不小于0的整数，且首位非0
			if($.trim($maxDelayDay.val()).length==0){
				$.message("error","请输入最长延时起保时间");
				$maxDelayDay.focus();
				return false;
			}else{
				var maxDelayDayReg = new RegExp("^(0|[1-9][0-9]*|-[1-9][0-9]*)$");
				var delayflag = maxDelayDayReg.test($maxDelayDay.val());
				if(!delayflag){
					$.message("error","最短延时起保时间必须是不小于0的整数");
					$maxDelayDay.focus();
					return false;
				}
				if(parseInt($minDelayDay.val())>parseInt($maxDelayDay.val())){
					$.message("error","最长延时起保时间不能小于最短延时起保时间");
					$maxDays.focus();
					return false;
				}
			}
			//最小保险期间：大于等于1的正整数
			if($.trim($minDays.val()).length==0){
				$.message("error","请输入最小保险期间");
				$minDays.focus();
				return false;
			}else{
				var minDayReg = new RegExp("^[1-9][0-9]*$");
				var minDayflag = minDayReg.test($minDays.val());
				if(!minDayflag){
					$.message("error","最小保险期间必须是不小于1的整数");
					$minDays.focus();
					return false;
				}
			}
			//最大保险期间：大于等于1的正整数，且必须大于最小保险期间
			if($.trim($maxDays.val()).length==0){
				$.message("error","请输入最大保险期间");
				$maxDays.focus();
				return false;
			}else{
				var maxDayReg = new RegExp("^[1-9][0-9]*$");
				var maxDayflag = maxDayReg.test($maxDays.val());
				if(!maxDayflag){
					if($maxDays.val()!=0){
						$.message("error","最大保险期间必须是不小于1的整数");
						$maxDays.focus();
						return false;
					}
				}
				if(parseInt($minDays.val())>parseInt($maxDays.val())){
					$.message("error","最大保险期间不能小于最小保险期间");
					$maxDays.focus();
					return false;
				}
			}
			/* 	//销售类型校验  2015年7月15日09:09:58
              var $agentType= $("#agentType");
              if($agentType.val()==""){
                  $.message("error","请选择销售类型");
                  $agentType.focus();
                  return false;
              } */
			//即时投保限制
			if($.trim($instant.val()).length==0){
				$.message("error","即时投保限制不能为空");
				$instant.focus();
				return false;
			}
			//是否限制投保年龄
			if($limit.val()==""){
				$.message("error","请选择投保年龄限制");
				$limit.focus();
				return false;
			}else{
				var minageVal = $.trim($minAge.val());
				var maxageVal = $.trim($maxAge.val());
				var minageUnitVal = $.trim($minAgeUnit.val());
				var maxageUnitVal = $.trim($maxAgeUnit.val());
				if($limit.val()=="Y"){
					if(minageVal==""){
						$.message("error","请输入最低年龄");
						$minAge.focus();
						return false;
					}
					if(maxageVal==""){
						$.message("error","请输入最高年龄");
						$maxAge.focus();
						return false;
					}
					if(minageUnitVal==""){
						$.message("error","请选择最低年龄单位");
						$minageUnitVal.focus();
						return false;
					}
					if(maxageUnitVal==""){
						$.message("error","请选择最高年龄单位");
						$maxageUnitVal.focus();
						return false;
					}
					var regAge = /^([1-9]\d{0,2}|0)$/;
					if(!regAge.test(minageVal)){
						$.message("error","被保人年龄请输入0-999的整数");
						$minAge.focus();
						return false;
					}
					if(!regAge.test(maxageVal)){
						$.message("error","被保人年龄请输入0-999的整数");
						$maxAge.focus();
						return false;
					}

					if(minageUnitVal=="y" && maxageUnitVal=="d"){
						$.message("error","最低年龄单位不能大于最高年龄单位");
						return false;
					}else if(minageUnitVal=="d" && maxageUnitVal=="y"){
						if((Number(minageVal)/366)>Number(maxageVal)){
							$.message("error","最低年龄不能大于最高年龄");
							return false;
						}
					}else{
						if(Number(minageVal)>Number(maxageVal)){
							$.message("error","最低年龄不能大于最高年龄");
							return false;
						}
					}
				}
			}
			//是否限制最低投保人数
			if($insuredNoLimit.val()==""){
				$.message("error","请选择最低投保人数限制");
				$insuredNoLimit.focus();
				return false;
			}else{
				var minInsuredNo = $.trim($minInsuredNo.val());
				if($insuredNoLimit.val()=="Y"){
					if(minInsuredNo==""){
						$.message("error","请输入最低投保人数");
						$minInsuredNo.focus();
						return false;
					}else{
						var regMinAge = /^([1-9]\d{0,2}|0)$/;
						if(!regMinAge.test(minInsuredNo)){
							$.message("error","请输入0-999的整数");
							$minAge.focus();
							return false;
						}
					}
				}
			}
			//最大份数：不小于0的整数，且首位非0
			if($.trim($unitPp.val()).length==0){
				$.message("error","请输入最大份数");
				$unitPp.focus();
				return false;
			}else{
				var unitPpReg = new RegExp("^(0|[1-9][0-9]*)$");
				var ppflag = unitPpReg.test($unitPp.val());
				if(!ppflag){
					$.message("error","最大份数必须是不小于0的整数");
					$unitPp.focus();
					return false;
				}
			}
			//广西学平险增加方案类型不能为空
			var $planType = $("#planType");
			return true;
		}

		//添加产品
		function addProduct(){

			if(!checkFormFormate())return;
			var $prodInstCode = $("#prodInstCode");
			var $prodInstName = $("#prodNme");
			var $tradProdDesc = $("#tradProdDesc");
			var $poolType = $("#poolType");
			var $tradAppType = $("#tradAppType");
			var $unitPp = $("#unitPp");
			var $maxDelayDay = $("#maxDelayDay");
			var $minDelayDay = $("#minDelayDay");
			var $instant = $("#instant");
			var $minDays = $("#minDays");
			var $maxDays = $("#maxDays");
			var $PPP_UNIT = $("#PPP_UNIT");
			var $prodType = $("#prodType");
			var $limit = $("#ageLimit");
			var $minAge = $("#minAge");
			var $maxAge = $("#maxAge");
			var $minAgeUnit = $("#minAgeUnit");
			var $maxAgeUnit = $("#maxAgeUnit");
			var $maxOccupLevel=$("#maxOccupLevel");
			var $insuredNoLimit=$("#insuredNoLimit");
			var $minInsuredNo= $("#minInsuredNo");
			/* var $agentType= $("#agentType"); */
			var longestCancelDay_val=$("#longestCancelDay").val();
			var tradProdDesc_val=$tradProdDesc.val();
			var poolType_val = $poolType.val();
			var tradAppType_val=$tradAppType.val();
			var prodInstCode_val=$prodInstCode.val();
			var instant_val=$instant.val();
			var maxDelayDay_val=$maxDelayDay.val();
			var minDelayDay_val=$minDelayDay.val();
			var minDays_val=$minDays.val();
			var maxDays_val=$maxDays.val();
			var PPP_UNIT_val=$PPP_UNIT.val();
			var unitPp_val=$unitPp.val();
			var prodType_val=$prodType.val();
			var limit_val=$limit.val();
			var minage_val = $minAge.val();
			var maxage_val = $maxAge.val();
			var minAgeUnit_val = $minAgeUnit.val();
			var maxAgeUnit_val = $maxAgeUnit.val();
			var maxOccupLevel_val=$maxOccupLevel.val();
			var insuredNoLimit_val=$insuredNoLimit.val();
			var minInsuredNo_val= $minInsuredNo.val();
			var epolicyCode=$("#epolicyCode").val();
			var epolicyTitle=$("#epolicyTitle").val();
			var isSocial = $("#isSocial").val();
			var waitStage = $("#waitStage").val();
			var yearDeductible = $("#yearDeductible").val();
			var payRate = $("#payRate").val();
			var claimLimit = $("#claimLimit").val();
			var isSuppleCare = $("#isSuppleCare").val();
			var graceStage = $("#graceStage").val();
			//最短延时起保时间单位
			var minDelayUnit = $("#minDelayUnit").val()
			/**电子保单标题为空则使用产品名称**/
			if(epolicyCode!=''&&epolicyTitle==''){
				epolicyTitle=tradProdDesc_val;
			}
			var planType = $("#planType").val();
			/*-----------------2015年6月4日16:37:54-----wangyan------add↓---*/
			var adjustObj = new Object();
			adjustObj.adjustId =$("#adjust").val();
			var adjustLis = [];
			/*抗癌保新增字段*/
			var coPayRate='';//共付比例
			var isCityIllness='';//有无城乡大病医疗保险
			/*多保障计划新增字段*/
			var rationArr=[];
			var rationObj=new Object();
			var isRation = $("#ratiion_select").val();
			var premiumCheck=$("#PREMIUM_CHECK").val();
			var continueMaxAge = $("#continueMaxAge").val();
			var continueMaxAgeUnit = $("#continueMaxAgeUnit").val();

			//是否分期
			var isByStaged = $("#isByStaged").val();
			//是否互联网专属条款
			var isInternetClause = $("#isInternetClause").val();
			//判断时间合法
			if(isNaN(continueMaxAge)){
				$.message("error","续保时间应为数字");
				return;
			}
			/* 	$("#adjustDiv").find("div").each(function(){
                    var adjust = new Object();
                    $(this).find("input[type='text']").each(function(){
                        if($(this).attr("name")=="peoplenum"){
                            adjust.peoplenum=$(this).val();
                        }
                        if($(this).attr("name")=="coefficient"){
                            adjust.coefficient=$(this).val();
                        }
                    });
                    adjustLis.push(adjust);
                });
                adjustObj.adjustList= adjustLis;
                var adjustStr_val = JSON.stringify(adjustObj); */
			/*-----------------2015年6月4日16:37:54------wangyan-----add↑-----*/

			/*--------------------新增多保障计划开始----------------------------*/
			var html = $("#ration_table_tboday").html()
			var flag = $("#ratiion_select").val();
			if("Y"==flag){
				if(html.replace(/\s+/g,"")==""){
					$.message("error","保障计划不能为空");
					return;
				}
			}
			if(isRation=='Y'&&premiumCheck==""){
				$.message("error","保费校验不能为空");
				return;
			}
			$("#ration_table").find("tbody").find("tr").each(function (){
				var ration = new Object();
				var tdArr = $(this).children();
				ration.rationid=tdArr.eq(0).html();
				ration.rationname=tdArr.eq(1).html();
				ration.jobLevel=tdArr.eq(2).html();
				rationArr.push(ration);
			})
			rationObj.rationList=rationArr
			var rations = JSON.stringify(rationObj);
			/*--------------------新增多保障计划结束----------------------------*/
			var param = {
				coreProdCode:prodInstCode_val,
				prodName:tradProdDesc_val,
				appType:tradAppType_val,
				instant:instant_val,
				maxDelayDay:maxDelayDay_val,
				minDelayDay:minDelayDay_val,
				maxDays:maxDays_val,
				minDays:minDays_val,
				maxNumber:unitPp_val,
				prodType:prodType_val,
				poolType:poolType_val,
				ageLimit:limit_val,
				minAge:minage_val,
				maxAge:maxage_val,
				minAgeUnit:minAgeUnit_val,
				maxAgeUnit:maxAgeUnit_val,
				maxOccupLevel:maxOccupLevel_val,
				insuredNoLimit:insuredNoLimit_val,
				minInsuredNo:minInsuredNo_val,
				pppUnit:PPP_UNIT_val,
				longestCancelDay:longestCancelDay_val,
				epolicyTitle:epolicyTitle,
				epolicyCode:epolicyCode,
				rations:rations,
				isRation:isRation,
				premiumCheck:premiumCheck,
				minDelayUnit:minDelayUnit,
				planType:planType,
				riskMainType:riskMainType,
				continueMaxAge:continueMaxAge,
				continueMaxAgeUnit:continueMaxAgeUnit,
				isSocial:isSocial,
				isSuppleCare:isSuppleCare,
				waitStage:waitStage,
				payRate:payRate,
				yearDeductible:yearDeductible,
				graceStage:graceStage,
				claimLimit:claimLimit,
				isByStaged:isByStaged,
				isInternetClause:isInternetClause
			};

			saveTradProInst(param);
		}
		function saveTradProInst(param){
			if(!Formstatus){
				$.message("error", "正在处理中...");
				return;
			}
			Formstatus=false;
			$.openLoading();
			vreset();
			$.ajax({
				url : "nlifeProductConfig/saveNewLifeProd?"+new Date().getTime(),
				type : 'POST',
				async : true,
				dataType:'json',
				data:param,
				success : function(obj) {
					//表单状态
					Formstatus=true;
					$.closeLoading();
					if($.validate(obj))return;
					tradProdCode=obj.type.prodCode;
					$.dialog({
						type: "success",//success,error
						content: "产品添加成功,是否继续添加 条款配置",
						onCancel:function(){
							openProductList();
							return;
						},
						onOk: function() {
							openInsurance();
							return;
						}
					});

				}
			});
		}


		function bindredio(){
			$("input[name='radioTemple']").click(function(){
				$("input[name='radioTemple']").parent().parent().removeClass("table_highlighter");
				$(this).parent().parent().addClass("table_highlighter");

			});
		}
		function loadtemplet(param){
			$.openLoading();
			$.ajax({
				url : "nlifeProductConfig/newLifeLoadTemplet",
				type : 'POST',
				async : true,
				dataType:'json',
				data:param,
				success : function(page) {
					$.closeLoading();
					if($.validate(page))return;
					var plans=page.obj.securityPlans;
					if(plans&&map.isEmpty()){
						// 2030保障计划
						var orther0Array=new Array();
						// 2039保障计划
						var orther1Array=new Array();
						// 2048保障计划
						var orther2Array=new Array();

						for (var i = 0; i < plans.length; i++) {
							if(parseInt(plans[i].otherCode)==0){
								orther0Array.push(plans[i])
							}
							if(parseInt(plans[i].otherCode)<=1){
								orther1Array.push(plans[i])
							}
						}
						map.put("2030", orther0Array);
						map.put("2039", orther1Array);
						map.put("2048", orther1Array);
					}
					startP = page.current;
					var firstbutton ="<input class='input_fxk' name='radioTemple' type='radio' value=''>";
					var tableContent = creatTable1("COREPRODCODE,COREPRODNAME,RISKMAINTYPE@TDH",page,firstbutton,null);
					var tableObj = $("#productTempletTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent);

					var strPage = creatChannelPage(startP,6,page.maxPage,"51");
					var pageDIV = $("#productTempletpageDIV");
					pageDIV[0].innerHTML="";
					pageDIV.append(strPage);
					bindredio();
					$("#addtempletDiv").OpenDiv();

				}
			});
		}

		function queryNewLifeProductTemplet(pagenum){
			var prodNme= $("#fprodNme").val();
			var instCode= $("#finstCode").val();
			loadtemplet({current:pagenum,size:10,coreProdName:prodNme,coreProdCode:instCode});
		}
		function chooseTemplet(){
			/* 	$('.InstCode2030').hide();
                $('.InstCode2039').hide();
                $('.InstCode2041').hide();//隐藏
                $('.InstCode2047').hide(); */
			var radioTemple = $("input[name='radioTemple']:checked");
			var instCode= radioTemple.parent().parent().children(" td:eq(1)").html();
			var prodNme= radioTemple.parent().parent().children(" td:eq(2)").html();
			riskMainType = radioTemple.parent().parent().children(" td:eq(3)").html();
			$("#prodNme").val(prodNme);
			$("#prodInstCode").val(instCode);
			closetempletDiv();
		}
		function fvreset(){
			$("#fprodNme").val("");
			$("#finstCode").val("");
		}

		function vreset(){
			$("#prodInstCode").val("");
			$("#prodName").val("");
			$("#prodNme").val("");
			$("#unitPp").val("");
			$("#maxDelayDay").val("");
			$("#minDelayDay").val("");
			$("#minDays").val("");
			$("#maxDays").val("");
			$("#tradProdDesc").val("");
			$("#tradAppType").find("option[value='0']").attr("selected",true);
			$("#instant").find("option[value='N']").attr("selected",true);
			$("#special").find("option[value='']").attr("selected",true);
			$("#epolicyCode").find("option[value='']").attr("selected",true);
			$('#epolicyTitle').val("");
			$('#poolType').val("");

			$("#longestCancelDay").val(0);
			$("#prodType").val(0);
			$("#ageLimit").val("");
			$("#maxAge").val('');
			$("#minAge").val('');
			$("#maxAge").attr('readOnly',true);
			$("#minAge").attr('readOnly',true);
			$("#maxAge").css('background-color','#ccc');
			$("#minAge").css('background-color','#ccc');
			$("#minAgeUnit").val("")
			$("#minAgeUnit").attr("disabled", true);
			$("#minAgeUnit").css("background-color", '#ccc');
			$("#maxAgeUnit").val("")
			$("#maxAgeUnit").attr("disabled", true);
			$("#maxAgeUnit").css("background-color", '#ccc');

			$("#maxOccupLevel").val("");
			$("#insuredNoLimit").val("");
			$("#minInsuredNo").val("");
			$("#minInsuredNo").attr('readOnly',true);
			$("#minInsuredNo").css('background-color','#ccc');
			/* $("#agentType").val(0); */
			var falg= $("#ratiion_select").val("N");
			$("#ratiion_button").attr("disabled", true);
			$("#ration_title_div").hide()
			$("#rarion_list_div").hide()
			$("#ration_table_tboday").html("")
			$("#PREMIUM_CHECK").val("")
			$("#PREMIUM_CHECK").attr("disabled", true);
			$("#PREMIUM_CHECK").css("background-color", '#ccc');
			//特殊产品标识
			riskMainType = "";
		}
		function opentempletDiv(obj){
			$("#"+obj.id).blur();
			loadtemplet("");
		}
		function closetempletDiv(){
			fvreset();
			$("#addtempletDiv").CloseDiv();
		}
		function openProductList(){
			window.location.href='<%=basePath%>nlifeProductConfig/list';
		}
		function openInsurance(){
			window.location.href='<%=basePath%>nlifeProductConfig/newLifeRiskAddReq?tradProdCode='+tradProdCode;
		}

		//选择是否限制投保年龄下拉框
		function checkLimit(obj){
			var limitFlag = obj.value;
			if(limitFlag=="Y"){
				$('#minAge').attr('readOnly',false);
				$('#minAge').css('background-color','white');
				$('#maxAge').attr('readOnly',false);
				$('#maxAge').css('background-color','white');
				$("#minAgeUnit").attr("disabled", false);
				$("#minAgeUnit").css("background-color", 'white');
				$('#maxAgeUnit').attr('disabled',false);
				$('#maxAgeUnit').css('background-color','white');
				$('#continueMaxAge').attr('readOnly',false);
				$('#continueMaxAge').css('background-color','white');
				$('#continueMaxAgeUnit').attr('disabled',false);
				$('#continueMaxAgeUnit').css('background-color','white');
			}else{
				$('#minAge').attr('readOnly',true);
				$('#minAge').css('background-color','#ccc');
				$('#maxAge').attr('readOnly',true);
				$('#maxAge').css('background-color','#ccc');
				$('#minAgeUnit').attr('disabled',true);
				$('#minAgeUnit').css('background-color','#ccc');
				$('#maxAgeUnit').attr('disabled',true);
				$('#maxAgeUnit').css('background-color','#ccc');
				$('#maxAge').val('');
				$('#minAge').val('');
				$('#continueMaxAge').attr('readOnly',true);
				$('#continueMaxAge').css('background-color','#ccc');
				$('#continueMaxAgeUnit').attr('disabled',true);
				$('#continueMaxAgeUnit').css('background-color','#ccc');
				$('#continueMaxAge').val('');
			}
		}
		//选择是否限制最低投保人数下拉框
		function checkInsuredNoLimit(obj){
			var personFlag = obj.value;
			if(personFlag=="Y"){
				$('#minInsuredNo').attr('readOnly',false);
				$('#minInsuredNo').css('background-color','white');
			}else{
				$('#minInsuredNo').attr('readOnly',true);
				$('#minInsuredNo').css('background-color','#ccc');
				$('#minInsuredNo').val('');
			}
		}
		//校验折扣系数
		function chectAdjust(){
			var  flag= true;
			$("#adjustDiv").find("input[type='text']").each(function(){
				if($(this).attr("name")=="peoplenum"){
					if($.trim($(this).val())==""){
						$.message("error","折扣系数:人数不能为空");
						$(this).focus();
						flag= false;
						return false;
					}else{
						var regPeopleNum = /^([1-9]\d{0,3}|0)$/;
						if(!regPeopleNum.test($(this).val())){
							$.message("error","折扣系数(人数):请输入0-9999的整数");
							$(this).focus();
							flag= false;
							return false;
						}
					}
				}else if($(this).attr("name")=="coefficient"){
					if($.trim($(this).val())==""){
						$.message("error","折扣系数:百分比不能为空");
						$(this).focus();
						flag= false;
						return false;
					}else{
						var regCoefficient = /^([1-9]\d{0,2}|0)$/;
						if(!regCoefficient.test($(this).val())){
							$.message("error","折扣系数(百分比):请输入0-999的整数");
							$(this).focus();
							flag= false;
							return false;
						}
					}
				}
			});
			return flag;
		}
		function changeAdjust(){
			var adjustVal= $("#adjust").val();
			if(adjustVal==""){
				$("#adjustDiv").empty();
				$("#adjustDiv").append("<div>"+
						"<input name='peoplenum' type='text' style='background-color: #ccc;width:55px;' readonly='readonly'  class='input_text'>&nbsp;人&nbsp;<input name='coefficient' type='text'  style='background-color: #ccc;width:55px;' readonly='readonly' class='input_text'>&nbsp;%&nbsp;&nbsp;<input type='button'  id='addSale' value='+' onclick='addAdjustDiv()'>"
						+"</div>");
			}else{
				$("#adjustDiv").find("input[type='text']").each(function(){
					$(this).attr('readOnly',false);
					$(this).css('background-color','white');
				});
			}
		}
		function isSocialChange(param){
			var paramValue = param.value;
			if(paramValue=="001"){
				$("#isSuppleCare").val("B2");
				$('#isSuppleCare').attr('disabled',false);
				$('#isSuppleCare').css('background-color','white');
			}else{
				$("#isSuppleCare").val("B1");
				$('#isSuppleCare').attr('disabled',true);
				$('#isSuppleCare').css('background-color','#ccc');
			}
		}
		function ratiionChange(){
			var falg= $("#ratiion_select").val();
			if(falg=="Y"){
				$("#ratiion_button").attr("disabled", false);
				$("#PREMIUM_CHECK").attr("disabled", false);
				$("#PREMIUM_CHECK").css("background-color", 'white');
				$("#ration_title_div").show()
				$("#rarion_list_div").show()
			}else{
				$("#ratiion_button").attr("disabled", true);
				$("#PREMIUM_CHECK").attr("disabled", true);
				$("#PREMIUM_CHECK").css("background-color", '#ccc');
				$("#PREMIUM_CHECK").val("");
				$("#ration_title_div").hide()
				$("#rarion_list_div").hide()
				$("#ration_table_tboday").html("")
			}
		}
		function ratiionClick(){
			var selectOptions="";
			for (var i=0;i<levelUpArr.length;i++){
				selectOptions+="<option value='"+levelUpArr[i]+"'>"+levelUpArr[i]+"类</option>"
			}
			var tdStrs="";
			for(var i=1;i<=2;i++){
				var tdStr="";
				for(var j=1;j<=4;j++){
					if(j==1){
						tdStr+="<tr><td><span>"+i+"</span></td>"
					}else if(j==2){
						tdStr+="<td><input id='rationName"+i+"' type='text' style='width:100%;' class='input_text'></td>"
					}else if(j==3){
						tdStr+="<td><select id='level_up"+i+"' style='width: 100%;height: 23px;' class='input_text' onchange='levelUpChange(this)'><option value=''></option>"+selectOptions+"</select></td>"
					}else if(j==4){
						tdStr+="<td><select id='level_down"+i+"' style='width: 100%;height: 23px;' class='input_text' ></select></td></tr>"
					}
				}
				tdStrs+=tdStr;
			}
			var tableObj = $("#rationTable");
			tableObj.find("tbody").remove();
			tableObj.append(tdStrs);

			$("#addProdRationDiv").OpenDiv();
		}
		function addLine(){
			var numberLine =parseInt($("#rationTable tr:last").find('td').children()[0].innerHTML)+1;
			var tdStr="";
			var selectOptions="";
			for (var i=0;i<levelUpArr.length;i++){
				selectOptions+="<option value='"+levelUpArr[i]+"'>"+levelUpArr[i]+"类</option>"
			}
			tdStr+="<tr><td><span>"+numberLine+"</span></td>"+"<td><input id='rationName"+numberLine+"' type='text' style='width:100%;' class='input_text'></td>"+"<td><select id='level_up"+numberLine+"' style='width: 100%;height: 23px;' class='input_text' onchange='levelUpChange(this)'><option value=''></option>"+selectOptions+"</select></td>"+"<td><select id='level_down"+numberLine+"' style='width: 100%;height: 23px;' class='input_text' ></select></td></tr>"

			$("#rationTable").find("tbody").append(tdStr)
		}
		var siveTimer=null;
		function saveRation(){
			var numberLine =parseInt($("#rationTable tr:last").find('td').children()[0].innerHTML);
			for(var i=1;i<=numberLine;i++){
				var rationName=$("#rationName"+i).val();
				var level_up=$("#level_up"+i).val();
				var level_down=$("#level_down"+i).val();
				if(rationName==""){
					$.message("error","第"+i+"行保障计划名称不能为空");
					return;
				}
				if(level_up==""){
					$.message("error","第"+i+"行职业级别不能为空");
					return;
				}
				if(level_down==""){
					$.message("error","第"+i+"行职业级别不能为空");
					return;
				}
			}
			$.openLoading();
			siveTimer = setTimeout(function(){
				var rationListTableLine
				var tableObj = $("#ration_table");
				var count = $("#ration_table").find("tbody").find("tr")
				if(count.length==0){
					rationListTableLine=1
				}else{
					rationListTableLine =parseInt($("#ration_table tr:last").find('td').html())+1;
				}
				var numberLine =parseInt($("#rationTable tr:last").find('td').children()[0].innerHTML);
				var lastbutton = "<td><a href='javascript:void(0)' onclick='deleteLine(this);return false'>删除</a></td>"
				var tdStrs=""
				for(var i=1;i<=numberLine;i++){
					var tdStr=""
					var rationName=$("#rationName"+i).val()
					var jobLevel=$("#level_up"+i).val()+"-"+$("#level_down"+i).val();
					tdStrs+="<tr><td>"+rationListTableLine+"</td>"+"<td>"+rationName+"</td><td style='display:none'>"+jobLevel+"</td><td>"+jobLevel+"类</td>"+lastbutton+"</tr>"
					rationListTableLine++
				}
				$("#ration_table").find("tbody").append(tdStrs)
				$("#addProdRationDiv").CloseDiv();
				$.closeLoading();
			},500)
		}
		var timer = null;
		function deleteLine(param){
			var rationNumber;
			var trs;
			$.openLoading();
			timer = setTimeout(function(){
				$(param).parent().parent().remove();
				trs = $("#ration_table").find("tbody").find("tr")
				for(var i=1;i<=trs.length;i++){
					$(trs[i-1]).find('td').eq(0).html(i)
				}
				$.closeLoading();
			}, 500);
		}

		function levelUpChange(param){
			var id =$(param).parent().parent().find('td').children()[0].innerHTML
			var selectValue = $("#level_up"+id).val();
			var levelDownOption = "";
			for(var i=selectValue;i<=6;i++){
				levelDownOption+="<option value = '"+i+"'>"+i+"类</option>"
			}
			$("#level_down"+id).html(levelDownOption);
		}

		function closeProdRationDiv(){
			$("#addProdRationDiv").CloseDiv();
		}
	</script>
	<style type="text/css">
		.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}

	</style>
</head>
<body>
<div class="current">
	<table class="current_table_1">
		<tbody>
		<tr class="f2">
			<td>
				<img src="./images/current_1.jpg">
			</td>
			<td class="current_table_1_td">
				<img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
				<span style=" color:#136bab; ">新意健险产品管理
                      <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>产品配置
                      <span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>新增产品
                  </span>
			</td>
			<td><img src="./images/current_3.jpg"></td>
		</tr>
		</tbody>
	</table>
</div>

<form id="inputForm" >
	<table class="table_05">
		<tbody>
		<tr>
			<td colspan="4" style=" font-size:12px; font-weight:bold; text-align:left;color:#3876bf; line-height:17px; background-image:url(images/centent_1.jpg)">新增产品</td>
		</tr>
		<tr>
			<th width="22%">产品模板代码：</th>
			<td width="25%">
				<input name="prodInstCode" id="prodInstCode" type="text" readonly="readonly" style=" background-color: #ccc;" class="input_text"><span class="red">*</span>&nbsp;
				<input type="button"   id="searchBtn" value="选择模板" onClick="opentempletDiv(this)"/></td>
			<th width="20%">产品模板名称：</th>
			<td width="28%"><input id="prodNme"  type="text" readonly="true" style=" background-color: #ccc;" class="input_text"><span class="red">*</span></td>
		</tr>
		<tr>
			<th>交易系统产品名称：</th>
			<td><input name="tradProdDesc"  id="tradProdDesc" type="text" maxlength="100" class="input_text"><span class="red">*</span></td>
			<th>共保选项：</th>
			<td><select id="poolType"  class="select_1" style="visibility: visible;">
				<option value="">---请选择---</option>
				<c:forEach var ="polPoolType" items="${polPoolType}">
					<option value="${polPoolType.code}">${polPoolType.codeName}</option>
				</c:forEach>
			</select><!-- <span class="red">*</span> --></td>
		</tr>
		<tr>
			<th>个团标识：</th>
			<td><select name="tradAppType" id="tradAppType" class="select_1" style="visibility: visible;"><option value="0">个单</option><option value="1">团单</option></select><span class="red">*</span></td>
		
		</tr>
		<tr>
			<th>最短延时起保时间：</th>
			<td><input name="minDelayDay"  id="minDelayDay" type="text" maxlength="5" class="input_text"><span class="red">*</span>
				<span>
	                  		<select id = "minDelayUnit">
	                  			<option value="d">天</option>
	                  			<option value="h">小时</option>
	                  			<option value="m">分钟</option>
	                  		</select>
	                  	</span>
				<span class="blue">支持负数</span></td>
			<th>最长延时起保时间：</th>
			<td><input name="maxDelayDay"  id="maxDelayDay" type="text" maxlength="5" class="input_text"><span class="red">*</span></td>
		</tr>
		<tr>
			<th>最长起保后注销天数：</th>
			<td><input name="longestCancelDay"  id="longestCancelDay" type="text" maxlength="5" class="input_text" value="0"><span class="red">*</span></td>
			<th>保险期间：</th>
			<td>
				<input name="minDays" id="minDays" type="text" maxlength="5"  class="input_text" style="width:60px;">&nbsp;至&nbsp;
				<input name="maxDays" id="maxDays" type="text" maxlength="5"  class="input_text" style="width:60px;">&nbsp;&nbsp;
				<select name="PPP_UNIT" id="PPP_UNIT" class="select_1"  style="width:55px;visibility: visible;">
					<c:forEach var ="periodType" items="${insurePeriodList}">
						<option value="${periodType.code}">${periodType.codeName}</option>
					</c:forEach>
				</select><span class="red">*</span>
			</td>
		</tr>
		<tr>
			<th>是否支持即时投保：</th>
			<td><select name="instant" id="instant" class="select_1" style="visibility: visible;"><option value="N">否</option><option value="Y">是</option></select><span class="red">*</span></td>
		</tr>
		<tr>
			<th>最高职业类别：</th>
			<td><select name="maxOccupLevel" id="maxOccupLevel" class="select_1" style="visibility: visible;">
				<option value="">不限制</option>
				<option value="1">1类</option>
				<option value="2">2类</option>
				<option value="3">3类</option>
				<option value="4">4类</option>
				<option value="5">5类</option>
				<option value="6">6类</option>
			</select><span class="red">*</span></td>
			<th>被保人年龄限制：</th>
			<td>
				<select id="ageLimit" onchange="checkLimit(this)" class="select_1" style="visibility: visible;width:50px;">
					<option value="">--请选择--</option>
					<option value="Y">是</option>
					<option value="N">否</option>
				</select><span class="red">*</span>
				<input id="minAge" type="text" readonly="true" style=" background-color: #ccc;width:25px;" class="input_text">
				<select id="minAgeUnit"  class="select_1" disabled="disabled" style="visibility: visible;width:50px;">
					<option value="">-选择-</option>
					<option value="y">周岁</option>
					<option value="d">天</option>
				</select>
				到
				<input id="maxAge" type="text" readonly="true" style=" background-color: #ccc;width:25px;" class="input_text">
				<select id="maxAgeUnit" class="select_1" disabled="disabled" style="visibility: visible;width:50px;">
					<option value="">-选择-</option>
					<option value="y">周岁</option>
					<option value="d">天</option>
				</select>
				续保到：
				<input id="continueMaxAge" type="text"  style=" width:25px;" class="input_text">
				<select id="continueMaxAgeUnit" class="select_1" style="visibility: visible;width:50px;">
					<option value="">-选择-</option>
					<option value="y">周岁</option>
					<option value="d">天</option>
				</select>
			</td>
		</tr>
		<tr>
			<th>最低被保人数限制：</th>
			<td>
				<select id="insuredNoLimit" onchange="checkInsuredNoLimit(this)" class="select_1" style="visibility: visible;width:100px;">
					<option value="">----请选择----</option>
					<option value="Y">是</option>
					<option value="N">否</option>
				</select><span class="red">*</span>
				<input id="minInsuredNo" name="minInsuredNo" type="text" readonly="true" style=" background-color: #ccc;width:55px;" class="input_text">&nbsp;人
			</td>
			<th>最大份数：</th>
			<td><input name="unitPp"  id="unitPp" type="text" maxlength="5" class="input_text"><span class="red">*</span></td>
		</tr>
		<tr>
			<th>是否多保障计划</th>
			<td>
				<select id="ratiion_select" onchange="ratiionChange()">
					<option value="N">否</option>
					<option value="Y">是</option>
				</select>
				<input id="ratiion_button" type="button"  disabled="disabled" value="保障计划录入" onclick="ratiionClick()"><span class="red">*</span>
			</td>
			<th>保费校验：</th>
			<td>
				<select id="PREMIUM_CHECK" class="select_1" style="visibility: visible;background-color: #ccc;" disabled="disabled">
					<option value="">---请选择---</option>
					<option value="1">标准保费</option>
					<option value="2">最低保费</option>
				</select><span class="red">*</span>
			</td>
		</tr>
		<tr>
			<th>是否支持分期</th>
			<td>
				<select id="isByStaged" class="select_1" style="visibility: visible;width:100px;">
					<option value="N">否</option>
					<option value="Y">是</option>
				</select>
			</td>
			<th>是否互联网专属条款</th>
			<td>
				<select id="isInternetClause" class="select_1" style="visibility: visible;width:100px;">
					<option value="N">否</option>
					<option value="Y">是</option>
				</select>
			</td>
		</tr>
	</table>
</form>
<!-- 多保障计划开始 -->
<div id="ration_title_div" style="display: none;">
	<table class="ration_table_title">
		<tr>
			<td colspan="6"
				style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">保障计划信息</td>
		</tr>
	</table>
</div>
<div id="rarion_list_div" style="display: none;  overflow:scroll; width:100%; height:30%">
	<table class="ration_table" id="ration_table">
		<thead>
		<tr>
			<th style="width: 20%;">编号</th>
			<th style="width: 40%">保障计划名称</th>
			<th style="width: 20%">职业级别</th>
			<th style="width: 10%">编辑</th>
		</tr>
		</thead>
		<tbody id="ration_table_tboday">
		</tbody>
	</table>
</div>
<div align="center" style="margin-top: 7px;">
	<input id="sub" class="input_button_1" name="" type="button"
		   value="保存" onclick="addProduct()">&nbsp;&nbsp; <input
		class="input_button_1" name="" onclick="vreset()" type="button"
		value="重置">
</div>
<!-- 列表隐藏DIV -->
<div id="addProdRationDiv" style="display: none; width: 90%;">
	<input type="hidden" id="row_num" name="row_num" value="0" />
	<div style='width: 100%; line-heighe: 20px; background-color: #A4BDE3'>
		<table class="table_title">
			<tr>
				<td width="100%" id="interfaceName"></td>
				<td width="40px" align="right"><img src="<%=path%>/images/closedown.gif" alt="关闭"
													onclick="closeProdRationDiv()" /></td>
			</tr>
		</table>
	</div>
	<div style="width: 100%; height: 190px; overflow: scroll;" id="addDiv">
		<table class="table_02" id="addrationTable" align="center" style="margin-top: 3px">
			<tbody>
			<tr>
				<td>
					<table id="rationTable" class="content_table_1">
						<thead>
						<tr class="f1">
							<th style="width: 20%;">编号</th>
							<th style="width: 40%;">保障计划名称</th>
							<th style="width: 20%;">职业级别</th>
							<th style="width: 20%;">职业级别</th>
						</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</td>
			</tr>
			</tbody>
		</table>
		<div align="center" style="position: relative; z-index:2;left: auto; right: auto;   ">
			<input class="input_button_3" name="" type="button" onclick="saveRation()" value="保存">&nbsp;&nbsp;
			<input class="input_button_3" name="" type="button" onclick="closeProdRationDiv()" value="取消">&nbsp;&nbsp;
			<input class="input_button_3" name="" type="button" onclick="addLine()" value="新增">
			<input type="hidden" id="hiddenButton" value="">
		</div>
	</div>
</div>
<!-- 多保障计划结束 -->

<!--   	添加模板 DIV 默认隐藏-->
<div id="addtempletDiv"  style="display:none;width:80%">
	<input type="hidden" id="row_num" name="row_num" value="0"/>
	<div class="table_title_div">
		<table class="table_title" style='width:100%;'>
			<tr>
				<td width="10%"></td>
				<td width="80%" id="interfaceName"></td>
				<td width="10%" align="right"><img src="<%=path%>/images/closedown.gif" alt="关闭"  onclick="closetempletDiv()"/></td>
			</tr>

		</table>
	</div>
	<form id="inputForm" action="save.jhtml" method="post" enctype="multipart/form-data">

		<table class="table_02" id="addtempletTable" style="height:180px;" align="center" >
			<tbody>
			<tr>
				<td>
					<table class="search_table">
						<tbody>
						<tr height="30px">
							<td width="40%" height="30px">产品模板代码：
								<input name="txt3" id="finstCode" type="text" class="input_text" value="" style="width:220px;">
							</td>
							<td width="40%" height="30px">产品模板名称：
								<input name="txt3" id="fprodNme" type="text" class="input_text" value="" style="width:220px;">
							</td>
							<td width="20%" height="30px">
								<input type="button" class="input_button_1" id="searchBtn" value="查询" onclick="queryNewLifeProductTemplet(1)">&nbsp;
								<input type="button" class="input_button_1" id="searchBtn" value="重置" onclick="fvreset()">
							</td>
						</tr>
						</tbody>
					</table>
				</td>
			</tr>
			<tr>
				<td>
					<table id="productTempletTable"  class="content_table_1">
						<thead>
						<tr class="f1">
							<th style="width:10%">选择</th>
							<th style="width:45%">产品模板代码</th>
							<th style="width:45%">产品模板名称</th>
						</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
					<div id="productTempletpageDIV"  class="page"></div>
				</td>
			</tr>
			</tbody>
		</table>
		<div align="center">
			<input class="input_button_3" name="" type="button" onclick="chooseTemplet()" value="确定">&nbsp;&nbsp;
			<input class="input_button_3" name="" type="button" onclick="closetempletDiv()" value="取消">
		</div>
	</form>
</div>
</body>
</html>